
#include "ndk_JNIObject.h"

JNIEXPORT jobject JNICALL Java_ndk_JNIObject_createJavaObjFromC
  (JNIEnv *env, jobject jobj)
{
	// jobject 是JNIObject.java

	// 获取Point的class，name = "全类名"
	jclass point_clz = (*env)->FindClass(env,"ndk/Point");
	// 获取Java层构造方法，构造方法用<init>
	jmethodID point_jmid = (*env)->GetMethodID(env,point_clz,"<init>","(II)V");
	// 构建java层对象
	jobject point_obj = (*env)->NewObject(env,point_clz,point_jmid,11,22);
	// 调用对重中的某个方法
	jmethodID j_setID = (*env)->GetMethodID(env,point_clz,"setX","(I)V");
	(*env)->CallVoidMethod(env,point_obj,j_setID,999);
	return point_obj;
}

